home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles Flirt Up Your Life! (German)
/
Singles Flirt Up Your Life.iso
/
data1.cab
/
Statemachine
/
questRomance10.lua
< prev
next >
Wrap
Text File
|
2004-01-29
|
2KB
|
96 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print ("questRomance10 entered");
setState("initial");
end )
-- on game over: relationship conditions get reset to 0 and all quests are reset to initial
onMsg("questreset", function(msg)
setState("initial");
end )
---------------------------------------------------------------------------------------------------------------------------------------
onDefault( function(msg)
print(" ~~~~~~~~~~~~~~ "..getState());
--setState( "initial");
end )
state("initial")
onMsg("checkCondition", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if ( -- condition here
----------------
min( mike.getRelationshipCondition(ELAINE, REL_ROMANCE),
elaine.getRelationshipCondition(MIKE, REL_ROMANCE) )>=10)
----------------
then
-- wait for sex
setState("comeOn");
end
end )
state("comeOn")
onMsg("queueInteraction", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if (msg.data == "getIntimateBed") then
setState("hadSex");
end
end )
state("hadSex")
onMsg("checkCondition", function(msg)
local ibed = getInteractionBed(getParent().getParent().getCharacter(MIKE), getParent().getParent().getCharacter(ELAINE));
if (ibed) then
--elaine.pushCommand("pm_talkCutscene", "talkCutscene", mike, "");
--sendDelayedMsgThis("talking",2000);
setState("talktome");
end
end )
state("talktome")
-- assoon as arrived - start dialog
----------------
--onMsg("talking", function(msg)
onEnter( function(msg)
popupConversation("dialogRomance10");
setState("donetalktome");
----------------
end )
state("donetalktome")
----------------
onMsg("yes", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
mike.cancelCurrentActivity();
elaine.cancelCurrentActivity();
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- sackgasse hier
endStateMachine()